package com.jpress.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name="pessoaNewsletter")
@NamedQueries({
	@NamedQuery(name="PessoaNewsletter.findByEmail", query="SELECT p FROM PessoaNewsletter p WHERE p.email = :email"),
	@NamedQuery(name="PessoaNewsletter.pesquisar", query="SELECT p FROM PessoaNewsletter p WHERE p.nome LIKE :nome AND p.email LIKE :email"),
	@NamedQuery(name="PessoaNewsletter.findAll", query="SELECT p FROM PessoaNewsletter p")
})
public class PessoaNewsletter implements Serializable {
	
	private static final long serialVersionUID = -6285708083136313753L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="codigo")
	private int codigo;
	
	@Column(name="nome", nullable=false, length=100)
	private String nome;
	
	@Column(name="email", unique=true, nullable=false, length=100)
	private String email;

	public int getCodigo() {
		return codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	
}
